<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>备忘录</title>
</head>
<body>
<input id="t" placeholder="备忘录标题"/>
<br/><br/>
<textarea rows="12" cols="88" id="c" placeholder="备忘录内容"></textarea>
<br/><br/>
<button onclick="save()">保存</button>
<script>
    function save() {
        //Ajax
        var request = new XMLHttpRequest();
        request.open("get", "/add_beiwang?title=" + t.value + "&content=" + c.value);
        request.send();
        request.onreadystatechange = function () {
            if (request.readyState == 4 && request.status == 200) {
                alert("新增成功！");
            }
        }
    }
</script>
</body>
</html>